package com.titanium.client.Titanium;

import com.google.gwt.user.client.Window;
import com.titanium.client.Titanium.Media.Sound;

public class Titanium
{

	/**
	 * Return the current platform, usually one of 'osx', 'win32', or 'linux'.
	 * @return current platform
	 */
	public static native String getPlatform() /*-{
	 return Titanium.getPlatform();
	}-*/;
	
	/**
	 * Return the Titanium runtime version.
	 * @return Titanium runtime version.
	 */
	public static native String getVersion() /*-{
	 return Titanium.getVersion();
	}-*/;
	
	/**
	 * The ALL event constant. This can be used for listening for all events.
	 */
	public static native String ALL() /*-{
	 return Titanium.ALL;
	}-*/;
	
	/**
	 * The APP_EXIT event constant, fired during host application exit.
	 */
	public static native String APP_EXIT() /*-{
	 return Titanium.APP_EXIT;
	}-*/;
	
	/**
	 * The CLOSE event constant
	 */
	public static native String CLOSE() /*-{
	 return Titanium.CLOSE;
	}-*/;
	
	/**
	 * The CLOSED event constant
	 */
	public static native String CLOSED() /*-{
	 return Titanium.CLOSED;
	}-*/;
	
	/**
	 * The CREATE event constant
	 */
	public static native String CREATE() /*-{
	 return Titanium.CREATE;
	}-*/;
	
	/**
	 * The EXIT event constant
	 */
	public static native String EXIT() /*-{
	 return Titanium.EXIT;
	}-*/;
	
	/**
	 * The FOCUSED event constant
	 */
	public static native String FOCUSED() /*-{
	 return Titanium.FOCUSED;
	}-*/;
	
	/**
	 * The FULLSCREENED event constant
	 */
	public static native String FULLSCREENED() /*-{
	 return Titanium.FULLSCREENED;
	}-*/;
	
	/**
	 * The HIDDEN event constant
	 */
	public static native String HIDDEN() /*-{
	 return Titanium.HIDDEN;
	}-*/;
	
	/**
	 * Request has been aborted.
	 */
	public static native String HTTP_ABORT() /*-{
	 return Titanium.HTTP_ABORT;
	}-*/;
	
	/**
	 * Data has been received from server.
	 */
	public static native String HTTP_DATA_RECEIVED() /*-{
	 return Titanium.HTTP_ABORT;
	}-*/;
	
	/**
	 * Data has been sent to server.
	 */
	public static native String HTTP_DATA_SENT() /*-{
	 return Titanium.HTTP_DATA_SENT;
	}-*/;
	
	/**
	 * The request has completed.
	 */
	public static native String HTTP_DONE() /*-{
	 return Titanium.HTTP_DONE;
	}-*/;
	
	/**
	 * HTTP redirect occurred.
	 */
	public static native String HTTP_REDIRECT() /*-{
	 return Titanium.HTTP_REDIRECT;
	}-*/;
	
	/**
	 * HTTP state has changed.
	 */
	public static native String HTTP_STATE_CHANGED() /*-{
	 return Titanium.HTTP_STATE_CHANGED;
	}-*/;
	
	/**
	 * Request has timed out.
	 */
	public static native String HTTP_TIMEOUT() /*-{
	 return Titanium.HTTP_TIMEOUT;
	}-*/;
	
	/**
	 * The MAXIMIZED event constant
	 */
	public static native String MAXIMIZED() /*-{
	 return Titanium.MAXIMIZED;
	}-*/;
	
	/**
	 * The MINIMIZED event constant
	 */
	public static native String MINIMIZED() /*-{
	 return Titanium.MINIMIZED;
	}-*/;
	
	/**
	 * The MOVED event constant
	 */
	public static native String MOVED() /*-{
	 return Titanium.MOVED;
	}-*/;
	
	/**
	 * The OPEN event constant
	 */
	public static native String OPEN() /*-{
	 return Titanium.OPEN;
	}-*/;
	
	/**
	 * The OPEN_REQUEST event constant
	 */
	public static native String OPEN_REQUEST() /*-{
	 return Titanium.OPEN_REQUEST;
	}-*/;
	
	/**
	 * The OPENED event constant
	 */
	public static native String OPENED() /*-{
	 return Titanium.OPENED;
	}-*/;
	
	/**
	 * The PAGE_INITIALIZED event constant
	 */
	public static native String PAGE_INITIALIZED() /*-{
	 return Titanium.PAGE_INITIALIZED;
	}-*/;
	
	/**
	 * The PAGE_LOADED event constant
	 */
	public static native String PAGE_LOADED() /*-{
	 return Titanium.PAGE_LOADED;
	}-*/;
	
	/**
	 * The READ event constant
	 */
	public static native String READ() /*-{
	 return Titanium.READ;
	}-*/;
	
	/**
	 * The RESIZED event constant
	 */
	public static native String RESIZED() /*-{
	 return Titanium.RESIZED;
	}-*/;
	
	/**
	 * The SHOWN event constant
	 */
	public static native String SHOWN() /*-{
	 return Titanium.SHOWN;
	}-*/;
	
	/**
	 * The UNFOCUSED event constant
	 */
	public static native String UNFOCUSED() /*-{
	 return Titanium.UNFOCUSED;
	}-*/;
	
	/**
	 * The UNFULLSCREENED event constant
	 */
	public static native String UNFULLSCREENED() /*-{
	 return Titanium.UNFULLSCREENED;
	}-*/;
	
	/**
	 * A module for holding core Titanium functionality.
	 * @author hexapode
	 *
	 */
	public static class API
	{

			
	}
	/**
	 * A module for dealing with media.
	 * @author hexapode
	 *
	 */
	public static class Media
	{
		
		/**
		 * Activate the system bell. Some systems may have disabled the system bell.
		 */
		public static native void beep() /*-{
		 Titanium.Media.beep();
		}-*/;
		
		/**
		 * Factory method for Sound objects, created given a path or a URL to a sound file. The types of sound files that can be played depend on the codecs installed on the user's system.
		 * @param path
		 * @return
		 */
		public static Sound createSound(String path)
		{
			Sound sound = new Sound(path);
			return sound;
		}
	}
}


